//
//  FQICenterViewController.swift
//  YQInformation
//
//  Created by Max on 2017/11/2.
//  Copyright © 2017年 com.vector. All rights reserved.
//

import UIKit

class FQICenterViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        if let v = FCIMainViewController.create() as? FCIMainViewController {
            let main = UINavigationController(rootViewController:v)
            main.tabBarItem.image = UIImage(named:"1")
            main.tabBarItem.selectedImage = UIImage(named:"5")
            main.tabBarItem.title = "主页"

            if let v = FCIDiscoverViewController.create() as? FCIDiscoverViewController {
                v.title = "发现"
                let discover = UINavigationController(rootViewController:v)
                discover.tabBarItem.image = UIImage(named:"2")
                discover.tabBarItem.selectedImage = UIImage(named:"6")
                discover.tabBarItem.title = "发现"
            
                if let v = FQICustomViewController.create() as? FQICustomViewController {
                    v.title = "精品推荐"
                    let custom = UINavigationController(rootViewController:v)
                    custom.tabBarItem.image = UIImage(named:"3")
                    custom.tabBarItem.selectedImage = UIImage(named:"7")
                    custom.tabBarItem.title = "定制"
                    
                    if let v = FQIMineViewController.create() as? FQIMineViewController {
                        v.title = "我的"
                        let mine = UINavigationController(rootViewController:v)
                        mine.tabBarItem.image = UIImage(named:"4")
                        mine.tabBarItem.selectedImage = UIImage(named:"8")
                        mine.tabBarItem.title = "我的"
                        self.viewControllers = [main,discover,custom,mine]
                    }
                }
            }
        }
        self.selectedIndex = 0
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}
